﻿@model AspDotNet.Framework.DatabaseFirst.ContosoSite.Models.Student

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<div>
    <h4>Student</h4>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.LastName)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.LastName)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.FirstName)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.FirstName)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.EnrollmentDate)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.EnrollmentDate)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.MiddleName)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.MiddleName)
        </dd>

    </dl>

    <table class="table">
        <tr>
            <th>
                Course Title
            </th>
            <th>
                Grade
            </th>
            <th>
                Credits
            </th>
        </tr>

        @foreach (var item in Model.Enrollments)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Course.Title)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Grade)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Course.Credits)
                </td>
            </tr>
        }
    </table>

</div>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.StudentID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
